package com.gzq.factorymethod.practice4;

import java.lang.reflect.InvocationTargetException;

public class BglImpl implements IBglFactory {

	@Override
	public <T extends IPeople> T crate(Class<T> c) {
		try {
			return c.getDeclaredConstructor().newInstance();
		} catch (InstantiationException | IllegalAccessException
				| IllegalArgumentException | InvocationTargetException
				| NoSuchMethodException | SecurityException e) {
			e.printStackTrace();
		}
		return null;
	}

}
